package com.its.cloud.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @author huguangjun
 * @className StorageMapper
 * @date 2021/1/18
 * @desc 10:53
 */
@Mapper
public interface StorageMapper {

    // 扣减库存
    @Update("update t_storage set used = used + #{count},residue = residue - #{count} where product_id =#{productId}")
    void decrease(@Param("productId") Long productId, @Param("count") Integer count);
}
